#ifndef RENDERHELPER_H
#define RENDERHELPER_H
#include "StompedReality/Asset/TextureInfo.h"
#include "StompedReality/Math/Vector2.h"
#include <gl\GL.h>
namespace StomperLib
{
class RenderHelper
{
 public:

  static void DrawRect( const StompedReality::Math::Vector2 start, const StompedReality::Math::Vector2 end )
  {
    glBegin( GL_LINE_LOOP );
    glVertex2f( start.GetX( ), start.GetY( ));
    glVertex2f( end.GetX( ), start.GetY( ));
    glVertex2f( end.GetX( ), end.GetY( ));
    glVertex2f( start.GetX( ), end.GetY( ));
    glEnd( );
  }

  static void RenderTexture( StompedReality::Asset::TextureInfo* textureInfo )
  {
    glColor3f ( 1, 1, 1 );
    glBindTexture ( GL_TEXTURE_2D, textureInfo->glBinding );
    glBegin ( GL_TRIANGLE_STRIP );
    glTexCoord2f ( 0, 1 );
    glVertex2i ( 0, textureInfo->height );
    glTexCoord2f ( 1, 1 );
    glVertex2i ( textureInfo->width, textureInfo->height );
    glTexCoord2f ( 0, 0 );
    glVertex2i ( 0, 0 );
    glTexCoord2f ( 1, 0 );
    glVertex2i ( textureInfo->width, 0 );
    glEnd( );
    glBindTexture ( GL_TEXTURE_2D, 0 );
    glColor3f ( 1, 1, 1 );
  }

};

}
#endif // ifndef RENDERHELPER_H